package com.ffms.servlet; /**
 * @author 从卿
 * @create 2022/3/12-9:26
 */

import com.ffms.dao.impl.FamilyMemberDaoImpl;
import com.ffms.entity.FamilyMember;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet("/PreAddZhichuServlet")
public class PreAddZhichuServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String name=req.getParameter("name");
        FamilyMemberDaoImpl familyMemberDao = new FamilyMemberDaoImpl();
        FamilyMember user = familyMemberDao.findAllByName(name);
        req.setAttribute("members",user);
        req.getRequestDispatcher("/admin/zhichuAdd.jsp").forward(req, resp);
    }
}
